/**
 * @Description: test
 * @Author: Hu Outstanding
 * @Date: 2022/2/19 9:43
 */
package com.aaa.three.controller;

import com.aaa.three.aop.Log;
import com.aaa.three.pojo.query.AdminInfoDept;
import com.aaa.three.result.AjaxResult;
import com.aaa.three.service.AdminQueryDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("dept")
public class AdminQueryDeptController {

    @Autowired
    private AdminQueryDeptService adminQueryDept;

    @RequestMapping("queryDepts")
    public AjaxResult queryAllDept(){
        return adminQueryDept.queryAllDept();
    }

    @RequestMapping("getDept/{id}")
    public AjaxResult getDept(@PathVariable("id") int id){
        return adminQueryDept.getDept(id);
    }

    @RequestMapping("deleteDept/{id}")
    @Log("删除部门")
    public AjaxResult deleteDept(@PathVariable("id") int id){
        return adminQueryDept.deleteDept(id);
    }

    @RequestMapping("addDept")
    @Log("添加部门")
    public AjaxResult addDept(AdminInfoDept adminInfoDept){
        return adminQueryDept.addDept(adminInfoDept);
    }

    @RequestMapping("updateDept")
    @Log("修改部门")
    public AjaxResult updateDept(AdminInfoDept adminInfoDept){
        return adminQueryDept.updateDept(adminInfoDept);
    }

    @RequestMapping("queryDeptState")
    public AjaxResult queryDeptState(){
        return adminQueryDept.queryDeptState();
    }

    @RequestMapping("queryDocState")
    public AjaxResult queryDocState(){
        return adminQueryDept.queryDocState();
    }


}
